package com.fxwater.websocket.service.impl;

import com.fxwater.websocket.service.IDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Author: 王明朝
 * @Date: 2019/8/17 12:00
 */
@Service
public class DataServiceImpl implements IDataService {

    @Autowired
    private JdbcTemplate jdbcTemplate;




    @PostConstruct
    public void test(){
        List<Map<String, Object>> data = selectData();
        System.out.println(data);
    }


    @Override
    public List<Map<String, Object>> selectData() {
        List<Map<String, Object>> list =  jdbcTemplate.queryForList("select * from fx_gg_dm");
        return list;
    }
}
